package com.imooc.bilibili.following.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imooc.bilibili.domain.following.FollowingGroup;
import com.imooc.bilibili.following.service.FollowingGroupService;
import com.imooc.bilibili.mapper.following.FollowingGroupMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author gcq
 * @Create 2022-05-21
 */
@Service
public class FollowingGroupServiceImpl extends ServiceImpl<FollowingGroupMapper, FollowingGroup> implements FollowingGroupService {

    @Autowired
    FollowingGroupMapper followingGroupMapper;

    @Override
    public FollowingGroup getByType(String type) {
        return followingGroupMapper.selectOne(new QueryWrapper<FollowingGroup>().eq("type", type));
    }
}